package com.md.mapper;

import com.md.entity.Course;
import com.md.entity.Teacher;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface TeacherMapper {
    @Select("select * from teacher where teacher_id=#{id}")
    Teacher selectOneTeacherById(int id);

    @Select("select * from teacher where teacher_id=#{id}")
    @Results({
            @Result(column = "teacher_id",property = "teacherId"),
            @Result(column = "teacher_id",property = "courseList",many=@Many(select = "com.md.mapper.CourseMapper.selectCourseByTeacherId"))
    })
    Teacher selectOneTeacherByTeacherId(int id);
}
